package com.milk.web.interceptor;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

import com.lorne.tx.dubbo.interceptor.TxManagerInterceptor;


@Aspect
@Component
public class TxTransactionInterceptor  implements Ordered{
	
	public TxTransactionInterceptor(){
		System.out.println("-----------------------TxTransactionInterceptor------------------------");
	}

    @Autowired
    private TxManagerInterceptor txManagerInterceptor;

    public int getOrder() {
        return 1;
    }

    @Around("execution(* com.milk.web.*Controller.*(..))")
    public Object around(ProceedingJoinPoint point)throws Throwable{
        return txManagerInterceptor.around(point);
    }
}
